package com.jeecms.wicool.manager.shops.impl;

import com.jeecms.common.hibernate3.Updater;
import com.jeecms.common.page.Pagination;
import com.jeecms.wicool.dao.shops.DistributionAddressDao;
import com.jeecms.wicool.entity.shops.DistributionAddress;
import com.jeecms.wicool.manager.shops.DistributionAddressMng;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by cuiyanlei on 15/7/15.
 */
@Service
@Transactional
public class DistributionAddressMngImpl implements DistributionAddressMng {
    @Override
    public DistributionAddress save(DistributionAddress bean) {
        return dao.save(bean);
    }

    @Override
    public DistributionAddress deleteById(Integer id) {
        return dao.deleteById(id);
    }

    @Override
    public DistributionAddress updateByUpdater(Updater<DistributionAddress> updater) {
        return dao.updateByUpdater(updater);
    }

    @Override
    public Pagination getPage(Integer shopId, String city, String district, String address, Integer pageNo, Integer pageSize) {
        return dao.getPage(shopId, city, district, address, pageNo, pageSize);
    }

    @Override
    public DistributionAddress findById(Integer id) {
        return dao.findById(id);
    }

    @Override
    public List<DistributionAddress> list(Integer shopId, String city, String district, String address) {
        return dao.list(shopId, city, district, address);
    }


    @Autowired
    private DistributionAddressDao dao;
}
